<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="pc137116">dropdb</title><body><p id="client_util_desc">Removes a database.</p><section id="section2"><title>Synopsis</title><codeblock id="client_util_synopsis">dropdb [&lt;connection-option> ...] [-e] [-i] &lt;dbname>

dropdb -? | --help

dropdb -V | --version</codeblock></section><section id="section3"><title>Description</title><p><codeph>dropdb</codeph> destroys an existing database. The user who
runs this command must be a superuser or the owner of the database
being dropped. </p><p><codeph>dropdb</codeph> is a wrapper around the SQL command <codeph>DROP DATABASE</codeph>. <ph
                                       >See the <i>Greenplum Database Reference
                                                Guide</i> for information about <codeph>DROP
                                                DATABASE.</codeph></ph></p></section><section id="section4"><title>Options</title><parml><plentry><pt><varname>dbname</varname></pt><pd>The name of the database to be removed.</pd></plentry><plentry><pt>-e | --echo</pt><pd>Echo the commands that <codeph>dropdb</codeph> generates and sends
to the server. </pd></plentry><plentry><pt>-i | --interactive</pt><pd>Issues a verification prompt before doing anything destructive. </pd></plentry>
       <plentry>
          <pt>-V | --version</pt>
          <pd>Print the <codeph>dropdb</codeph> version and exit.</pd>
        </plentry>
        <plentry>
          <pt>--if-exists</pt>
          <pd>Do not throw an error if the database does not exist. A notice is issued in this
            case.</pd>
        </plentry>
        <plentry>
          <pt>-? | --help</pt>
          <pd>Show help about <codeph>dropdb</codeph> command line arguments, and exit.</pd>
        </plentry></parml><sectiondiv id="section5"><b>Connection Options</b><parml><plentry><pt>-h <varname>host</varname> | --host=<varname>host</varname></pt><pd>The host name of the machine on which the Greenplum master database
                                                  server is running. If not specified, reads from
                                                  the environment variable <codeph>PGHOST</codeph>
                                                  or defaults to localhost.</pd></plentry><plentry><pt>-p <varname>port</varname> | --port=<varname>port</varname></pt><pd>The TCP port on which the Greenplum master database server is
                                                  listening for connections. If not specified, reads
                                                  from the environment variable
                                                  <codeph>PGPORT</codeph> or defaults to 5432.</pd></plentry><plentry><pt>-U <varname>username</varname> | --username=<varname>username</varname></pt><pd>The database role name to connect as. If not specified, reads from
the environment variable <codeph>PGUSER</codeph> or defaults to the current
system role name.</pd></plentry><plentry><pt>-w | --no-password</pt><pd>Never issue a password prompt. If the server requires password authentication
and a password is not available by other means such as a <codeph>.pgpass</codeph>
file, the connection attempt will fail. This option can be useful in
batch jobs and scripts where no user is present to enter a password.</pd></plentry><plentry><pt>-W | --password</pt><pd>Force a password prompt.</pd></plentry>
          <plentry>
            <pt>--maintenance-db=<varname>dbname</varname></pt>
            <pd>Specifies the name of the database to connect to in order to drop the target
              database. If not specified, the <codeph>postgres</codeph> database will be used; if
              that does not exist (or if it is the name of the database being dropped),
                <codeph>template1</codeph> will be used.</pd>
          </plentry></parml></sectiondiv></section><section id="section6"><title>Examples</title><p>To destroy the database named <codeph>demo</codeph> using default connection parameters:</p><codeblock>dropdb demo</codeblock><p>To destroy the database named <codeph>demo</codeph> using connection options, with verification,
        and a peek at the underlying command:</p><codeblock>dropdb -p 54321 -h masterhost -i -e demo
Database "demo" will be permanently deleted.
Are you sure? (y/n) y
DROP DATABASE "demo"
DROP DATABASE</codeblock></section><section id="section7">
                        <title>See Also</title>
                        <p><ph otherprops="op-print"><codeph>DROP DATABASE</codeph> in the
            <i>Greenplum Database Reference Guide</i></ph><ph><xref href="createdb.xml#topic1"/>,
            <xref href="../../ref_guide/sql_commands/DROP_DATABASE.xml#topic1"/></ph></p>
                </section></body></topic>
